home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / UCB Logo 3.0 / sources / standard source / ztcterm.h < prev   
Encoding:
C/C++ Source or Header  |  1993-08-14  |  4.0 KB  |  124 lines  |  [TEXT/JV01]

  1. /*
  2.  *      ztcterm.h          IBM-specific graphics macros         mak
  3.  *
  4.  *    Copyright (C) 1993 by the Regents of the University of California
  5.  *
  6.  *      This program is free software; you can redistribute it and/or modify
  7.  *      it under the terms of the GNU General Public License as published by
  8.  *      the Free Software Foundation; either version 2 of the License, or
  9.  *      (at your option) any later version.
  10.  *  
  11.  *      This program is distributed in the hope that it will be useful,
  12.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *      GNU General Public License for more details.
  15.  *  
  16.  *      You should have received a copy of the GNU General Public License
  17.  *      along with this program; if not, write to the Free Software
  18.  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  *
  20.  */
  21.  
  22. #define GR_SIZE 10000
  23.  
  24. #define prepare_to_draw gr_mode()
  25. #define done_drawing nop()
  26.  
  27. #define prepare_to_draw_turtle nop()
  28. #define done_drawing_turtle nop()
  29.  
  30. #define screen_height (1 + screen_bottom - screen_top)
  31. #define screen_width (1 + screen_right - screen_left)
  32.  
  33. #define screen_left 0
  34. #define screen_right (MaxX)
  35. #define screen_top 0
  36. #define screen_bottom (ibm_screen_bottom)
  37.  
  38. #define turtle_left_max -(MaxX/2)+1
  39. #define turtle_right_max (MaxX/2)
  40. #define turtle_top_max (MaxY/2)
  41. #define turtle_bottom_max (ibm_turtle_bottom_max)
  42.  
  43. #define turtle_height t_height()
  44. #define turtle_half_bottom t_half_bottom()
  45. #define turtle_side t_side()
  46.  
  47. #define screen_x_coord (screen_right)/2 + turtle_x
  48. #define screen_y_coord (MaxY)/2 - turtle_y
  49.  
  50. #define clear_screen erase_screen()
  51.  
  52. #define line_to(x,y) {if (current_vis==0) lineto((int)x,(int)y); else moveto((int)x,(int)y);}
  53. #define move_to(x,y) moveto((int)x,(int)y)
  54. #define draw_string(s) outtext((char *)s)
  55. #define set_pen_vis(v) current_vis = v
  56. #define set_pen_mode(m) set_ibm_pen_mode(m)
  57. #define set_pen_color(c) {ztc_set_penc(c);}
  58. #define set_back_ground(c) {ztc_set_bg(c);}
  59. #define set_pen_width(w) {ztc_penwidth = w;}
  60. #define set_pen_height(h) {ztc_penwidth = h;}
  61. #define set_pen_x(x) moveto((int)x, ztc_y)
  62. #define set_pen_y(y) moveto(ztc_x, (int)y)
  63.  
  64. /* pen_info is a stucture type with fields for the various
  65.    pen characteristics including the location, size, color,
  66.    mode (e.g. XOR or COPY), pattern, visibility (0 = visible) */
  67.  
  68. typedef struct { int    h;
  69.          int    v;
  70.          int    vis;
  71.          int    width;
  72.          int    color;
  73.          char    pattern[8];
  74.          int    mode; } pen_info;
  75.  
  76. #define p_info_x(p) p.h
  77. #define p_info_y(p) p.v
  78.  
  79. #define pen_width ztc_penwidth
  80. #define pen_height ztc_penwidth
  81. #define pen_mode get_ibm_pen_mode()
  82. #define pen_vis current_vis
  83. #define pen_x ztc_x
  84. #define pen_y ztc_y
  85. #define get_node_pen_pattern Get_node_pen_pattern()
  86. #define get_node_pen_mode Get_node_pen_mode()
  87.  
  88. #define pen_reverse ibm_pen_xor()
  89. #define pen_erase ibm_pen_erase()
  90. #define pen_down ibm_pen_down()
  91.  
  92. #define button Button()
  93. #define mouse_x mickey_x()
  94. #define mouse_y mickey_y()
  95.  
  96. #define full_screen f_screen()
  97. #define split_screen s_screen()
  98. #define text_screen t_screen()
  99.  
  100. /* definitions from term.c and math.c for ibmterm.c */
  101. extern int x_coord, y_coord, x_max, y_max, tty_charmode;
  102. extern char so_arr[], se_arr[];
  103. extern FLONUM degrad;
  104.  
  105. /* definitions from ibmterm.c for graphics.c */
  106. extern void gr_mode();
  107. extern void ibm_pen_erase(), ibm_pen_down(), ibm_pen_xor();
  108. extern void set_ibm_pen_mode();
  109. extern int get_ibm_pen_mode();
  110. extern void save_pen(), restore_pen(), set_pen_pattern();
  111. extern void plain_xor_pen();
  112. extern void set_list_pen_pattern(), get_pen_pattern(), erase_screen();
  113. extern void label(), logofill();
  114. extern void t_screen(), s_screen(), f_screen(), tone();
  115. extern FIXNUM mickey_x(), mickey_y();
  116. extern NODE *Get_node_pen_pattern(), *Get_node_pen_mode();
  117. extern FIXNUM t_height();
  118. extern FIXNUM pen_color, back_ground;
  119. extern FLONUM t_half_bottom(), t_side();
  120. extern int current_vis, ibm_screen_bottom, ibm_turtle_bottom_max;
  121. extern BOOLEAN in_erase_mode;
  122. extern int ztc_penwidth;
  123. extern fg_coord_t ztc_x, ztc_y;
  124.